package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;


/**
 * The persistent class for the SUPPLIES database table.
 * 
 */
@Entity
@Table(name="SUPPLIES")
@NamedQuery(name="Supply.findAll", query="SELECT s FROM Supply s")
public class Supply implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="SUPPLIES_ID")
	private String suppliesId;

	@Column(name="SUPPLIES_COMPANY")
	private String suppliesCompany;

	@Column(name="SUPPLIES_NAME")
	private String suppliesName;

	@Column(name="SUPPLIES_PRICE")
	private BigDecimal suppliesPrice;

	//bi-directional many-to-one association to StockTakingDetail
	@OneToMany(mappedBy="supply")
	private List<StockTakingDetail> stockTakingDetails;

	//bi-directional many-to-one association to SuppliesType
	@ManyToOne
	@JoinColumn(name="STYPE_ID")
	private SuppliesType suppliesType;

	public Supply() {
	}

	public String getSuppliesId() {
		return this.suppliesId;
	}

	public void setSuppliesId(String suppliesId) {
		this.suppliesId = suppliesId;
	}

	public String getSuppliesCompany() {
		return this.suppliesCompany;
	}

	public void setSuppliesCompany(String suppliesCompany) {
		this.suppliesCompany = suppliesCompany;
	}

	public String getSuppliesName() {
		return this.suppliesName;
	}

	public void setSuppliesName(String suppliesName) {
		this.suppliesName = suppliesName;
	}

	public BigDecimal getSuppliesPrice() {
		return this.suppliesPrice;
	}

	public void setSuppliesPrice(BigDecimal suppliesPrice) {
		this.suppliesPrice = suppliesPrice;
	}

	public List<StockTakingDetail> getStockTakingDetails() {
		return this.stockTakingDetails;
	}

	public void setStockTakingDetails(List<StockTakingDetail> stockTakingDetails) {
		this.stockTakingDetails = stockTakingDetails;
	}

	public StockTakingDetail addStockTakingDetail(StockTakingDetail stockTakingDetail) {
		getStockTakingDetails().add(stockTakingDetail);
		stockTakingDetail.setSupply(this);

		return stockTakingDetail;
	}

	public StockTakingDetail removeStockTakingDetail(StockTakingDetail stockTakingDetail) {
		getStockTakingDetails().remove(stockTakingDetail);
		stockTakingDetail.setSupply(null);

		return stockTakingDetail;
	}

	public SuppliesType getSuppliesType() {
		return this.suppliesType;
	}

	public void setSuppliesType(SuppliesType suppliesType) {
		this.suppliesType = suppliesType;
	}

}